<template>
  <div>
    <a-button @click="readonly = !readonly">开启禁用{{ readonly }}</a-button>
    <CodeEditor ref="codeEditor" v-model="code" language="html" :readOnly="readonly"></CodeEditor>

    <a-button type="primary" @click="logValue"> 获取</a-button>
    <a-button type="primary" @click="setHandel"> 设置值</a-button>
    <hr />
    {{ code }}
  </div>
</template>
<script setup>
import CodeEditor from "@/components/CodeEditor";
import { ref } from "vue";
const readonly = ref(true);
const codeEditor = ref();
const code = ref("99999");

const setHandel = () => {
  code.value = "<div>123</div>";
};

const logValue = e => {

  console.log(code.value);

}
</script>
<style lang='scss' scoped></style>